package com.bjpower.convent;

import com.bjpower.domain.PayWay;
import com.bjpower.models.vo.PayWayVo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import java.util.List;

@Mapper(componentModel = "spring", uses = {MapperHelder.class})
public interface PayWayVoConvent {
    @Mappings({@Mapping(source = "wayCode",target = "wayCode")
             ,@Mapping(source = "wayName",target = "wayName")
             ,@Mapping(source = "typeCode",target = "typeCode"),
              @Mapping(source = "typeName",target = "typeName"),
              @Mapping(source = "payProductCode",target = "productCode"),
              @Mapping(source = "payRate", target = "payRate"),
              @Mapping(source = "sorts" ,target = "sorts"),
              @Mapping(source = "status",target = "status", qualifiedByName = "statusConvent"),
              @Mapping(source = "editTime",target = "editTime", dateFormat = "yyyy-MM-dd HH:mm:ss")})
    PayWayVo toPayWayVo(PayWay payWay);

    List<PayWayVo> toPayWayVoList(List<PayWay> payWayList);
}
